(function(){/* 
 
 Copyright The Closure Library Authors. 
 SPDX-License-Identifier: Apache-2.0 
*/ 
function h(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function k(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:h(a)}}function l(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var m="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},n; 
if("function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var p;a:{var q={a:!0},r={};try{r.__proto__=q;p=r.a;break a}catch(a){}p=!1}n=p?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var t=n; 
function u(a,b){a.prototype=m(b.prototype);a.prototype.constructor=a;if(t)t(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.o=b.prototype};function v(a){var b=this;this.h=!1;this.g=[];a(function(c){w(b,c)})}function w(a,b){if(!a.h)if(b instanceof v)b.then(function(c){w(a,c)});else{a.h=!0;a.i=b;for(b=0;b<a.g.length;++b)x(a,a.g[b]);a.g=[]}}function x(a,b){a.h?b(a.i):a.g.push(b)}v.prototype.then=function(a){var b=this;return new v(function(c){x(b,function(d){c(a(d))})})};function y(){return new v(function(a){return a(void 0)})};function z(a){if(!a)throw Error("functionToExecute must not be truthy.");};function A(){return/\d+\.\d+\.\d+(-.*)?/.test("1.3.3-google_20200427")}function B(){for(var a=["1","3","3"],b=["1","0","3"],c=0;3>c;c++){var d=parseInt(a[c],10),e=parseInt(b[c],10);if(d>e)break;else if(d<e)return!1}return!0};function C(a,b,c,d){this.h=a;this.method=b;this.version=c;this.g=d}function D(a){return!!a&&void 0!==a.omid_message_guid&&void 0!==a.omid_message_method&&void 0!==a.omid_message_version&&"string"===typeof a.omid_message_guid&&"string"===typeof a.omid_message_method&&"string"===typeof a.omid_message_version&&(void 0===a.omid_message_args||void 0!==a.omid_message_args)}function E(a){return new C(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_args)} 
function F(a){var b={};b=(b.omid_message_guid=a.h,b.omid_message_method=a.method,b.omid_message_version=a.version,b);void 0!==a.g&&(b.omid_message_args=a.g);return b};function G(a){this.h=a};function H(a,b){return a&&(a[b]||(a[b]={}))};function I(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return"y"===a?(b&3|8).toString(16):b.toString(16)})};function J(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];K(function(){throw new (Function.prototype.bind.apply(Error,[null,"Could not complete the test successfully - "].concat(b instanceof Array?b:l(k(b)))));},function(){return console.error.apply(console,b instanceof Array?b:l(k(b)))})}function K(a,b){"undefined"!==typeof jasmine&&jasmine?a():"undefined"!==typeof console&&console&&console.error&&b()};var L=eval("this"),N=function(){if("undefined"!==typeof omidGlobal&&omidGlobal)return omidGlobal;if("undefined"!==typeof global&&global)return global;if("undefined"!==typeof window&&window)return window;if("undefined"!==typeof L&&L)return L;throw Error("Could not determine global object context.");}();function O(a){try{return a.frames?!!a.frames.omid_v1_present:!1}catch(b){return!1}};function P(a){this.h=a;this.handleExportedMessage=P.prototype.i.bind(this)}u(P,G);P.prototype.sendMessage=function(a,b){b=void 0===b?this.h:b;if(!b)throw Error("Message destination must be defined at construction time or when sending the message.");b.handleExportedMessage(F(a),this)};P.prototype.i=function(a,b){D(a)&&this.g&&this.g(E(a),b)};function Q(a){return null!=a&&"undefined"!==typeof a.top&&null!=a.top}function R(a){if(a===N)return!1;try{if("undefined"===typeof a.location.hostname)return!0}catch(b){return!0}return!1};function S(a,b){this.h=b=void 0===b?N:b;var c=this;a.addEventListener("message",function(d){if("object"===typeof d.data){var e=d.data;D(e)&&d.source&&c.g&&c.g(E(e),d.source)}})}u(S,G);S.prototype.sendMessage=function(a,b){b=void 0===b?this.h:b;if(!b)throw Error("Message destination must be defined at construction time or when sending the message.");b.postMessage(F(a),"*")};var T=["omid","v1_VerificationServiceCommunication"],U=["omidVerificationProperties","serviceWindow"];function V(a,b){return b.reduce(function(c,d){return c&&c[d]},a)};function W(a){if(!a){var b;"undefined"===typeof b&&"undefined"!==typeof window&&window&&(b=window);b=Q(b)?b:N;var c=void 0===c?O:c;a=[];var d=V(b,U);d&&a.push(d);a.push(Q(b)?b.top:N);a:{a=k(a);for(var e=a.next();!e.done;e=a.next()){b:{d=b;e=e.value;var f=c;if(!R(e))try{var g=V(e,T);if(g){var M=new P(g);break b}}catch(da){}M=f(e)?new S(d,e):null}if(d=M){a=d;break a}}a=null}}if(this.h=a)this.h.g=this.m.bind(this);else if(c=(c=N.omid3p)&&"function"===typeof c.registerSessionObserver&&"function"===typeof c.addEventListener? 
c:null)this.g=c;this.i={};this.j=(c=N.omidVerificationProperties)?c.injectionId:void 0}function X(a,b){z(b);a.g?a.g.registerSessionObserver(b,void 0,a.j):a.l("addSessionListener",b,void 0,a.j)}function aa(a,b){z(b);a.g?a.g.addEventListener("geometryChange",b):a.l("addEventListener",b,"geometryChange")} 
W.prototype.m=function(a){var b=a.method,c=a.h;a=a.g;if("response"===b&&this.i[c]){var d=A()&&B()?a?a:[]:a&&"string"===typeof a?JSON.parse(a):[];this.i[c].apply(this,d)}"error"===b&&window.console&&J(a)};W.prototype.l=function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];this.h&&(e=I(),b&&(this.i[e]=b),d=A()&&B()?d:JSON.stringify(d),this.h.sendMessage(new C(e,"VerificationService."+a,"1.3.3-google_20200427",d)))};var Y=void 0; 
if(Y=void 0===Y?"undefined"===typeof omidExports?null:omidExports:Y){var Z=["OmidVerificationClient"];Z.slice(0,Z.length-1).reduce(H,Y)[Z[Z.length-1]]=W};function ba(){var a=this.h=new W;this.i=!(!a.h&&!a.g);this.g=null;this.l=this.i?4:1;this.j=this.i} 
function ca(a){a.j?(a.g=new v(function(b){var c=new v(function(e){X(a.h,function(f){"sessionStart"==f.type&&e("app"==f.data.context.environment)})}),d=new v(function(e){aa(a.h,function(f){f=f.data;var g=f.adView.reasons;if(g=!g||-1==g.indexOf("hidden"))f=f.adView,f=f.onScreenContainerGeometry||f.onScreenGeometry,g=!!(f&&f.width&&f.height);g&&(a.l=3,e())})});c.then(function(e){e?d.then(function(){b()}):(a.l=1,b())})}),a.g.then(function(){a.j=!1})):a.g=y()};window.omrhp=function(a){var b=new ba;b.g||ca(b);b.g.then(a)};}).call(this);
